package cn.com.headfree.mouldshow.service.impl;

import cn.com.headfree.depterprela.service.impl.DeptErpRelaServiceImpl;
import cn.com.headfree.entity.*;
import cn.com.headfree.entity.isc.User;
import cn.com.headfree.mouldshow.dao.*;
import cn.com.headfree.mouldshow.service.HumanDataImportService;
import cn.com.headfree.mouldshow.service.TContestInfoService;
import cn.com.headfree.recordlog.service.IRecordLogService;
import cn.com.headfree.util.DateUtilCheck;
import cn.com.headfree.util.SysDictionaryUtil;
import cn.com.headfree.vo.SysDictionaryInfoVo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gta.edu.sdk.common.dto.Page;
import com.gta.edu.sdk.util.IdGen;
import com.gta.edu.sdk.util.StringUtil;

import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.NumberToTextConverter;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

/**
 * 竞赛考试信息 服务实现
 * @author smyl
 * @date 2020-06-23 15:59:50
 */
@Service("humanDataImportService")
@Transactional
public class HumanDataImportServiceImpl implements HumanDataImportService {

	private static final Logger LOG = LogManager.getLogger(HumanDataImportServiceImpl.class);

	private static SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM");

	private static SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd");

	@Autowired
	private TEmpBaseInfoTempDao tEmpBaseInfoTempDao;//基本信息

	@Autowired
	private TAcadeAchiveInfoTempDao tAcadeAchiveInfoTempDao;

	@Autowired
	private TContestInfoTempDao tContestInfoTempDao;

	@Autowired
	private TContiStudyInfoTempDao tContiStudyInfoTempDao;

	@Autowired
	private TEducateInfoTempDao tEducateInfoTempDao;

	@Autowired
	private TExpertTitleInfoTempDao tExpertTitleInfoTempDao;

	@Autowired
	private THonorInfoTempDao tHonorInfoTempDao;

	@Autowired
	private TPartRankTempDao tPartRankTempDao;

	@Autowired
	private TPatentInfoTempDao tPatentInfoTempDao;

	@Autowired
	private TProjAchieveInfoTempDao tProjAchieveInfoTempDao;

	@Autowired
	private TProjAwardInfoTempDao tProjAwardInfoTempDao;

	@Autowired
	private TProTecInfoTempDao tProTecInfoTempDao;

	@Autowired
	private TSdtAwardTempDao tSdtAwardTempDao;

	@Autowired
	private TSdtPrentInfoTempDao tSdtPrentInfoTempDao;

	@Autowired
	private TSdtTutorPrentInfoTempDao tSdtTutorPrentInfoTempDao;

	@Autowired
	private TSkillLevelInfoTempDao tSkillLevelInfoTempDao;

	@Autowired
	private TStandInfoTempDao tStandInfoTempDao;

	@Autowired
	private TTecInnovInfoTempDao tTecInnovInfoTempDao;

	@Autowired
	private TTecManInnovTempDao tTecManInnovTempDao;

	@Autowired
	private TWorkExpInfoTempDao tWorkExpInfoTempDao;

	@Autowired
	private TYearEffectInfoTempDao tYearEffectInfoTempDao;

	@Autowired
	private TEmployeeMobilityTempDao tEmployeeMobilityTempDao;

	@Autowired
	private TRotationInfoTempDao tRotationInfoTempDao;

	@Autowired
	private TPerformanceScoreTempDao tPerformanceScoreTempDao;

	//操作记录
	@Autowired
	private IRecordLogService recordLogService;

	@Autowired
	private DeptErpRelaServiceImpl deptErpRelaService;

	/**
	 * 验证表头
	 */
	@Value("${empBaseInfoTemp}")
	private String empBaseInfoTemp;

	@Value("${contestInfoTemp}")
	private String contestInfoTemp;

	@Value("${acadeAchiveInfoTemp}")
	private String acadeAchiveInfoTemp;

	@Value("${contiStudyInfoTemp}")
	private String contiStudyInfoTemp;

	@Value("${educateInfoTemp}")
	private String educateInfoTemp;

	@Value("${expertTitleInfoTemp}")
	private String expertTitleInfoTemp;

	@Value("${honorInfoTemp}")
	private String honorInfoTemp;

	@Value("${patentInfoTemp}")
	private String patentInfoTemp;

	@Value("${proTecInfoTemp}")
	private String proTecInfoTemp;

	@Value("${projAchieveInfoTemp}")
	private String projAchieveInfoTemp;

	@Value("${sdtTutorPrentInfoTemp}")
	private String sdtTutorPrentInfoTemp;

	@Value("${skillLevelInfoTemp}")
	private String skillLevelInfoTemp;

	@Value("${standInfoTemp}")
	private String standInfoTemp;

	@Value("${tecInnovInfoTemp}")
	private String tecInnovInfoTemp;

	@Value("${tecManInnovTemp}")
	private String tecManInnovTemp;

	@Value("${workExpInfoTemp}")
	private String workExpInfoTemp;

	@Value("${yearEffectInfoTemp}")
	private String yearEffectInfoTemp;

	@Value("${employeeMobilityTemp}")
	private String employeeMobilityTemp;

	@Value("${rotationInfoTemp}")
	private String rotationInfoTemp;

	@Value("${performanceScoreInfoTemp}")
	private String performanceScoreInfoTemp;


	//基本信息
	@Value("${t_emp_base_info}")
	private String t_emp_base_info;
	//年度绩效
	@Value("${t_year_effect_info}")
	private String t_year_effect_info;
	//学历信息
	@Value("${t_educate_info}")
	private String t_educate_info;
	//教育培训及授课经历
	@Value("${t_conti_study_info}")
	private String t_conti_study_info;
	//专业技术资格
	@Value("${t_pro_tec_info}")
	private String t_pro_tec_info;
	//技能等级信息
	@Value("${t_skill_level_info}")
	private String t_skill_level_info;
	//专家人才称号
	@Value("${t_expert_title_info}")
	private String t_expert_title_info;
	//学术成果
	@Value("${t_acade_achive_info}")
	private String t_acade_achive_info;
	//制度标准
	@Value("${t_stand_info}")
	private String t_stand_info;
	//专利信息
	@Value("${t_patent_info}")
	private String t_patent_info;
	//技艺革新信息
	@Value("${t_tec_innov_info}")
	private String t_tec_innov_info;
	//竞赛考试信息
	@Value("${t_contest_info}")
	private String t_contest_info;
	//科技管理及创新成果
	@Value("${t_tec_man_innov}")
	private String t_tec_man_innov;
	//个人荣誉
	@Value("${t_honor_info}")
	private String t_honor_info;
	//项目课题成果
	@Value("${t_proj_achieve_info}")
	private String t_proj_achieve_info;
	//导师带徒
	@Value("${t_sdt_tutor_prent_info}")
	private String t_sdt_tutor_prent_info;
	//工作经历
	@Value("${t_work_exp_info}")
	private String t_work_exp_info;
	//员工流动
	@Value("${t_employee_mobility}")
	private String t_employee_mobility;
	//挂职轮岗表
	@Value("${t_rotation_info}")
	private String t_rotation_info;

	@Override
	public String importHumanDatas(String easyName, MultipartFile file, User user) throws Exception{
			String fileName = file.getOriginalFilename();
			String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
			StringBuffer message = new StringBuffer();
			//使用POI解析Excel文件
			//如果是xls，使用HSSFWorkbook；2003年的excel  如果是xlsx，使用XSSFWorkbook  2007年excel
			Workbook workbook = null;
			if (suffix.equals("xls")) {
				workbook = new HSSFWorkbook(file.getInputStream());
			} else if (suffix.equals("xlsx")) {
				workbook = new XSSFWorkbook(file.getInputStream());
			}else{
				message.append("上传的文件格式错误");
				return message.toString();
			}
			if (workbook != null) {
				//获得当前sheet工作表
				Sheet sheet = workbook.getSheetAt(0);
				if (sheet != null) {
					//获得当前sheet的开始行
					int firstRowNum = sheet.getFirstRowNum();
					//获得当前sheet的结束行
					int lastRowNum = sheet.getLastRowNum();
//                    /标题行
					Row titleRow = sheet.getRow(firstRowNum+1);
					int coloumNum=sheet.getRow(firstRowNum+1).getPhysicalNumberOfCells();
					List<String> headers = new ArrayList<>();
					for(int i=0;i<coloumNum;i++){
						if(StringUtils.isNotBlank(titleRow.getCell(i).getStringCellValue())){
							headers.add(titleRow.getCell(i).getStringCellValue());
						}
					}
					if(headers.size() == 0){
						message.append("上传的文件错误");
						return message.toString();
					}
					String [] datas = null;
					//获取该单位所有人，以比对erpNo是否正确
					List<TDeptEmpRela> tDeptEmpRelaList = deptErpRelaService.getErpNoByOrgId(user.getBaseOrgId());
					List<String> erpNos = new ArrayList<>();
					if(tDeptEmpRelaList == null || tDeptEmpRelaList.size() == 0){
						message.append("获取人员数据失败");
						return message.toString();
					}else{
						erpNos = tDeptEmpRelaList.stream().map(p -> p.getErpNo()).collect(Collectors.toList());
					}
					switch (easyName) {
						case "jbxx"://基本信息临时数据
							//用判断表头是否一致的方式来确定当前上传的文件是否跟模板一致
							datas = empBaseInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTEmpBaseInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是基本信息类型数据");
								return message.toString();
							}
							break;
						case "xlxx"://学历信息临时数据
							datas = educateInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTEducateInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是学历信息类型数据");
								return message.toString();
							}
							break;
						case "gzjl"://工作经历临时数据
							datas = workExpInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTWorkExpInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是工作经历类型数据");
								return message.toString();
							}
							break;
						case "pxsk"://教育培训及授课信息临时数据
							datas = contiStudyInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTContiStudyInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是培训及授课类型数据");
								return message.toString();
							}
							break;
						case "grry"://个人荣誉临时数据
							datas = honorInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTHonorInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是个人荣誉类型数据");
								return message.toString();
							}
							break;
						case "jsks"://竞赛考试临时数据
							datas = contestInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTContestInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是竞赛考试类型数据");
								return message.toString();
							}
							break;
						case "zjrc"://专家人才临时数据
							datas = expertTitleInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTExpertTitleInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是专家人才类型数据");
								return message.toString();
							}
							break;
						case "zyzg"://专业资格临时数据
							datas = proTecInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTProTecInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是专业资格类型数据");
								return message.toString();
							}
							break;
						case "jndj"://技能等级临时数据
							datas = skillLevelInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTSkillLevelInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是技能等级类型数据");
								return message.toString();
							}
							break;
						case "dsdt"://导师带徒临时数据
							datas = sdtTutorPrentInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTSdtTutorPrentInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是导师带徒类型数据");
								return message.toString();
							}
							break;
						case "ndjx"://年度绩效临时数据
							datas = yearEffectInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTYearEffectInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是年度绩效类型数据");
								return message.toString();
							}
							break;
						case "xscg"://学术成果临时数据
							datas = acadeAchiveInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTAcadeAchiveInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是学术成果类型数据");
								return message.toString();
							}
							break;
						case "zdbz"://制度标准临时数据
							datas = standInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTStandInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是制度标准类型数据");
								return message.toString();
							}
							break;
						case "zlxx"://专利临时数据
							datas = patentInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTPatentInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是专利信息类型数据");
								return message.toString();
							}
							break;
						case "jygx"://技艺革新临时数据
							datas = tecInnovInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTTecInnovInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是技艺革新类型数据");
								return message.toString();
							}
							break;
						case "kjcx"://科技创新临时数据
							datas = tecManInnovTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTTecManInnovTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是科技创新类型数据");
								return message.toString();
							}
							break;
						case "ktcg"://课题成果临时数据
							datas = projAchieveInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTProjAchieveInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是项目课题成果类型数据");
								return message.toString();
							}
							break;
						case "ygld"://员工流动临时数据
							datas = employeeMobilityTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTEmployeeMobilityTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是员工流动类型数据");
								return message.toString();
							}
							break;
						case "gzlg"://挂职轮岗临时数据
							datas = rotationInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTRotationInfoTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是挂职轮岗类型数据");
								return message.toString();
							}
							break;
						case "jxjf"://绩效积分临时数据
							datas = performanceScoreInfoTemp.split(",");
							if(Arrays.equals(headers.toArray(),datas)){
								message = importTPerformanceScoreTempList(sheet,firstRowNum,lastRowNum,headers,user,erpNos);
							}else{
								message.append("上传的文件类型错误，不是绩效积分类型数据");
								return message.toString();
							}
							break;
					}
				}
			}
			if(message.length() > 0){
				return message.toString();
			}
		return null;
	}

	/**
	 * 基本信息入临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTEmpBaseInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TEmpBaseInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TEmpBaseInfoTemp temp = new TEmpBaseInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if (!(value.equals(""))){
							temp.setName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("性别")){
						if (!(value.equals(""))){
							String sexValue = SysDictionaryUtil.getValueByValueAndName("Gender",value);
							if(StringUtils.isNotBlank(sexValue)){
								temp.setSex(sexValue);
							}else{
								temp.setSex(value);
							}
						}else {
							message.append("第" + num + "行性别不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("出生日期")) {
						if (!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setBirthDate(sdf2.parse(value));
								}else{
									temp.setBirthDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行出生日期格式错误").append("<br/>");
							}

						} else {
							message.append("第" + num + "行出生日期不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("民族")) {
						if (!(value.equals(""))){
							String mzValue = SysDictionaryUtil.getValueByValueAndName("Nation",value);
							if(StringUtils.isNotBlank(mzValue)){
								temp.setNation(mzValue);
							}else {
								temp.setNation(value);
							}
						} else {
							message.append("第" + num + "行民族不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("籍贯")) {
						if (!(value.equals(""))){
							temp.setBirthPlace(value);
						} else {
							message.append("第" + num + "行籍贯不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("出生地")) {
						if (!(value.equals(""))){
							temp.setBornPlace(value);
						} else {
							message.append("第" + num + "行出生地不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("政治面貌")) {
						if (!(value.equals(""))){
							String zzmmValue = SysDictionaryUtil.getValueByValueAndName("PoliticalLandscapeText",value);
							if(StringUtils.isNotBlank(zzmmValue)) {
								temp.setPolitiStatus(zzmmValue);
							}else{
								temp.setPolitiStatus(value);
							}
						} else {
							message.append("第" + num + "行政治面貌不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("身份证号码")) {
						if (!(value.equals(""))){
							String regularExpression = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" +
									"(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
							boolean matches = value.matches(regularExpression);
							if(matches){
								temp.setIdCardNo(value);
							}else{
								message.append("第" + num + "行身份证号码格式输入不正确").append("<br/>");
							}
						} else {
							message.append("第" + num + "行身份证号码不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("手机号码")) {
						if (!(value.equals(""))){
							String regex = "^((13[0-9])|(14[579])|(15([0-3,5-9]))|(16[6])|(17[0135678])|(18[0-9]|19[89]))\\d{8}$";
							Pattern p = Pattern.compile(regex);
							Matcher m = p.matcher(value);
							boolean isMatch = m.matches();
							if(isMatch){
								temp.setMobilePhone(value);
							}else{
								message.append("第" + num + "行手机号码格式输入不正确").append("<br/>");
							}
						} else {
							message.append("第" + num + "行手机号码不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("岗级")) {
						if (!(value.equals(""))){
							temp.setLevel(value);
						} else {
							message.append("第" + num + "行岗级不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("薪级")) {
						if (!(value.equals(""))){
							temp.setSalaryGrade(value);
						} else {
							message.append("第" + num + "行薪级不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("参加工作时间")) {
						if (!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try{
								if(value.length()>7){
									temp.setJobDate(sdf2.parse(value));
								}else{
									temp.setJobDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行参加工作时间格式错误").append("<br>");
							}
						} else {
							message.append("第" + num + "行参加工作时间不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("入党时间")) {
						if (!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try{
								if(value.length()>7){
									temp.setPartyDate(sdf2.parse(value));
								}else{
									temp.setPartyDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行入党时间格式错误").append("<br>");
							}
						}else{
							i++;
						}
					}else if (headers.get(s).equals("单位")) {
						if (!(value.equals(""))){
							temp.setUnit(value);
						} else {
							message.append("第" + num + "行单位不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("部门")) {
						if (!(value.equals(""))){
							temp.setDept(value);
						} else {
							message.append("第" + num + "行部门不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("现任职务(岗位)")) {
						if (!(value.equals(""))){
							temp.setCurPost(value);
						} else {
							message.append("第" + num + "行现任职务(岗位)不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);

				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_emp_base_info);
				tEmpBaseInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了基本信息");
			});
		}
		return messages;
	}

	/**
	 * 学历信息入临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTEducateInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TEducateInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TEducateInfoTemp temp = new TEducateInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							i++;
							message.append("第" + num + "行姓名不能为空").append("<br/>");
						}
					}else if (headers.get(s).equals("学习开始时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try{
								if(value.length()>7){
									temp.setStartTime(sdf2.parse(value));
								}else{
									temp.setStartTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行学习开始时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行学习开始时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("学习结束时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try{
								if(value.length()>7){
									temp.setEndTime(sdf2.parse(value));
								}else{
									temp.setEndTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行学习结束时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行学习结束时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("学历取得时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try{
								if(value.length()>7){
									temp.setAcquTime(sdf2.parse(value));
								}else{
									temp.setAcquTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行学历取得时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行学历取得时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("是否全日制")) {
						if (!(value.equals(""))){
							if(value.equals("是")){
								temp.setIsContEduc("0");
							}else{
								temp.setIsContEduc("1");
							}
						} else {
							message.append("第" + num + "行是否继续教育不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("是否就业学历")) {
						if (!(value.equals(""))){
							if(value.equals("是")){
								temp.setIsEmployEduc("0");
							}else{
								temp.setIsEmployEduc("1");
							}
						} else {
							message.append("第" + num + "行是否就业学历不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("是否最高学历")) {
						if (!(value.equals(""))){
							if(value.equals("是")){
								temp.setIsHighestEduc("0");
							}else{
								temp.setIsHighestEduc("1");
							}
						} else {
							message.append("第" + num + "行是否最高学历不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("毕业院校")) {
						if (!(value.equals(""))){
							temp.setGradSchool(value);
						} else {
							message.append("第" + num + "行毕业院校不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("院校类别")) {
						if (!(value.equals(""))){
							String yxlbValue = SysDictionaryUtil.getValueByValueAndName("CollegeCategory",value);
							if(StringUtils.isNotBlank(yxlbValue)) {
								temp.setSchoolType(yxlbValue);
							}else{
								temp.setSchoolType(value);
							}
						} else {
							message.append("第" + num + "行院校类别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("所学专业")) {
						if (!(value.equals(""))){
							temp.setMajor(value);
						} else {
							message.append("第" + num + "行所学专业不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("学历名称")) {
						if (!(value.equals(""))){
							String xlValue = SysDictionaryUtil.getValueByValueAndName("PersonnelQualifications",value);
							if(StringUtils.isNotBlank(xlValue)){
								temp.setEducName(xlValue);
							}else{
								temp.setEducName(value);
							}
						} else {
							message.append("第" + num + "行学历名称不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("学位名称")) {
						if (!(value.equals(""))) {
							String xwValue = SysDictionaryUtil.getValueByValueAndName("AcademicDegree",value);
							if(StringUtils.isNotBlank(xwValue)){
								temp.setDegreeName(xwValue);
							}else{
								temp.setDegreeName(value);
							}
						}else{
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_educate_info);
				tEducateInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了学历信息");
			});
		}
		return messages;
	}

	/**
	 * 工作经历入临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTWorkExpInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TWorkExpInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TWorkExpInfoTemp temp = new TWorkExpInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("开始时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try{
								if(value.length()>7){
									temp.setStartDate(sdf2.parse(value));
								}else{
									temp.setStartDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行开始时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行开始时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("结束时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setEndDate(sdf2.parse(value));
								}else{
									temp.setEndDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行结束时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行结束时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("单位")) {
						if (!(value.equals(""))){
							temp.setCompany(value);
						}else {
							message.append("第" + num + "行单位不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("部门")) {
						if (!(value.equals(""))){
							temp.setDept(value);
						} else {
							message.append("第" + num + "行部门不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("职务")) {
						if (!(value.equals(""))){
							temp.setPost(value);
						} else {
							message.append("第" + num + "行职务不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("级别")) {
						if (!(value.equals(""))) {
							String zwjbValue = SysDictionaryUtil.getValueByValueAndName("DutyLevel",value);
							if(StringUtils.isNotBlank(zwjbValue)) {
								temp.setRank(zwjbValue);
							}else{
								temp.setRank(value);
							}
						}else{
							i++;
						}
					}else if (headers.get(s).equals("职务分工")) {
						if (!(value.equals(""))) {
							temp.setJobContent(value);
						}else{
							i++;
						}
					}else if (headers.get(s).equals("岗位类别")) {
						if (!(value.equals(""))) {
							String gwlbValue = SysDictionaryUtil.getValueByValueAndName("PostCategory",value);
							if(StringUtils.isNotBlank(gwlbValue)) {
								temp.setPostType(gwlbValue);
							}else{
								temp.setPostType(value);
							}
						}else{
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_work_exp_info);
				tWorkExpInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了工作经历信息");
			});
		}
		return messages;
	}

	/**
	 * 培训及授课临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTContiStudyInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TContiStudyInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TContiStudyInfoTemp temp = new TContiStudyInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("编号")){
						if(value.equals("")) {
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("开始时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try{
								if(value.length()>7){
									temp.setStartTime(sdf2.parse(value));
								}else{
									temp.setStartTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行开始时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行开始时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("结束时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setEndTime(sdf2.parse(value));
								}else{
									temp.setEndTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行结束时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行结束时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("类别")) {
						if(!(value.equals(""))){
							String lbValue = SysDictionaryUtil.getValueByValueAndName("PeixunshoukeType",value);
							if(StringUtils.isNotBlank(lbValue)) {
								temp.setType(lbValue);
							}else{
								temp.setType(value);
							}
						}else {
							message.append("第" + num + "行类型不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("专业或主要内容")) {
						if (!(value.equals(""))){
							temp.setMajor(value);
						} else {
							message.append("第" + num + "行是否是继续教育不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("学习/授课地点")) {
						if (!(value.equals(""))){
							temp.setStudyPlace(value);
						} else {
							message.append("第" + num + "行学习/授课地点不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("证明人")) {
						if (!(value.equals(""))) {
							temp.setCertifier(value);
						}else{
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_conti_study_info);
				tContiStudyInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了培训及授课信息");
			});
		}
		return messages;
	}

	/**
	 * 个人荣誉临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTHonorInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<THonorInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			THonorInfoTemp temp = new THonorInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("取得时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setAcquTime(sdf2.parse(value));
								}else{
									temp.setAcquTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行取得时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行取得时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("荣誉称号")) {
						if(!(value.equals(""))){
							temp.setHonorTitle(value);
						}else {
							message.append("第" + num + "行荣誉称号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("授予单位/部门")) {
						if(!(value.equals(""))) {
							temp.setAwardOrg(value);
						}else{
							message.append("第" + num + "行授予单位/部门不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("荣誉级别")) {
						if(!(value.equals(""))) {
							value = value.replace("（","(").replace("）",")");
							String ryjbValue = SysDictionaryUtil.getValueByValueAndName("JygexinQcJb",value);
							if(StringUtils.isNotBlank(ryjbValue)) {
								temp.setHonorLevel(ryjbValue);
							}else{
								temp.setHonorLevel(value);
							}
						}else{
							message.append("第" + num + "行荣誉级别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("荣誉类别")) {
						if(!(value.equals(""))) {
							String rylbValue = SysDictionaryUtil.getValueByValueAndName("RuYuLeiBie",value);
							if(StringUtils.isNotBlank(rylbValue)) {
								temp.setHonorType(rylbValue);
							}else{
								temp.setHonorType(value);
							}
						}else{
							message.append("第" + num + "行荣誉类别不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_honor_info);
				tHonorInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了个人荣誉信息");
			});
		}
		return messages;
	}

	/**
	 * 竞赛考试临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTContestInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TContestInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TContestInfoTemp temp = new TContestInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")) {
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("竞赛考试获奖时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setAwardDate(sdf2.parse(value));
								}else{
									temp.setAwardDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行竞赛考试获奖时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行竞赛考试获奖时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("专业竞赛考试名称")) {
						if(!(value.equals(""))){
							temp.setCompName(value);
						}else {
							message.append("第" + num + "行专业竞赛考试名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("竞赛考试主办部门")) {
						if(!(value.equals(""))){
							temp.setHostOrg(value);
						}else {
							message.append("第" + num + "行竞赛考试主办部门不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("竞赛考试获奖名称")) {
						if (!(value.equals(""))){
							temp.setAwardName(value);
						} else {
							message.append("第" + num + "行竞赛考试获奖名称不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("竞赛考试获奖级别")) {
						if (!(value.equals(""))){
							value = value.replace("（","(").replace("）",")");
							String hjjbValue = SysDictionaryUtil.getValueByValueAndName("JygexinQcJb",value);
							if(StringUtils.isNotBlank(hjjbValue)) {
								temp.setAwardLevel(hjjbValue);
							}else{
								temp.setAwardLevel(value);
							}
						} else {
							message.append("第" + num + "行竞赛考试获奖级别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("竞赛考试名次")) {
						if (!(value.equals(""))){
							String ksmcValue = SysDictionaryUtil.getValueByValueAndName("JygexinQcDj",value);
							if(StringUtils.isNotBlank(ksmcValue)) {
								temp.setCompRank(ksmcValue);
							}else{
								temp.setCompRank(value);
							}
						} else {
							message.append("第" + num + "行竞赛考试名次不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("是否获得称号")) {
						if (!(value.equals(""))){
							if(value.equals("是")){//0：是，1：否
								temp.setGetTitle("0");
							}else{
								temp.setGetTitle("1");
							}
						} else {
							message.append("第" + num + "行是否获得称号不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_contest_info);
				tContestInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了竞赛考试信息");
			});
		}
		return messages;
	}

	/**
	 * 专家人才临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTExpertTitleInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TExpertTitleInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TExpertTitleInfoTemp temp = new TExpertTitleInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("专业")){
						if(!(value.equals(""))){
							String zyValue = SysDictionaryUtil.getValueByValueAndName("ProWorkTypes",value);
							if(StringUtils.isNotBlank(zyValue)) {
								temp.setMajor(zyValue);
							}else{
								temp.setMajor(value);
							}
						}else {
							message.append("第" + num + "行专业不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("取得时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setAcquTime(sdf2.parse(value));
								}else{
									temp.setAcquTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行取得时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行取得时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("发文时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setPostTime(sdf2.parse(value));
								}else{
									temp.setPostTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行发文时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行发文时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("人才称号名称")) {
						if(!(value.equals(""))){
							String rcchValue = SysDictionaryUtil.getNameByValueForDefault("TalentTitle",value);
							temp.setEmpTitle(rcchValue);
						}else {
							message.append("第" + num + "行人才称号名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("等级")) {
						if (!(value.equals(""))){
							value = value.replace("（","(").replace("）",")");
							String zjdjValue = SysDictionaryUtil.getValueByValueAndName("ExpertLevel",value);
							if(StringUtils.isNotBlank(zjdjValue)) {
								temp.setLevelName(zjdjValue);
							}else{
								temp.setLevelName(value);
							}
						} else {
							message.append("第" + num + "行等级不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("类别")) {
						if (!(value.equals(""))){
							String zjlbValue = SysDictionaryUtil.getValueByValueAndName("ExpertCategory",value);
							if(StringUtils.isNotBlank(zjlbValue)) {
								temp.setType(zjlbValue);
							}else{
								temp.setType(value);
							}
						} else {
							message.append("第" + num + "行类别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("聘期开始时间")) {
						if (!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setEmpTermStart(sdf2.parse(value));
								}else{
									temp.setEmpTermStart(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行聘期开始时间格式错误").append("<br/>");
							}
						} else {
							message.append("第" + num + "行聘期开始时间不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("聘期结束时间")) {
						if (!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try{
								if(value.length()>7){
									temp.setEmpTermEnd(sdf2.parse(value));
								}else{
									temp.setEmpTermEnd(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行聘期结束时间格式错误").append("<br/>");
							}
						} else {
							message.append("第" + num + "行聘期结束时间不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_expert_title_info);
				tExpertTitleInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了专家人才信息");
			});
		}
		return messages;
	}

	/**
	 * 专业资格临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTProTecInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TProTecInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TProTecInfoTemp temp = new TProTecInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("取得时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setAcquTime(sdf2.parse(value));
								}else{
									temp.setAcquTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行取得时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行取得时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("发文时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setPostTime(sdf2.parse(value));
								}else{
									temp.setPostTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行发文时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行发文时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("专业技术资格名称")) {
						if(!(value.equals(""))){
							temp.setSubjName(value);
						}else {
							message.append("第" + num + "行专业技术资格名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("专业技术资格系列")) {
						if(!(value.equals(""))){
							String zgxlValue = SysDictionaryUtil.getValueByValueAndName("ProTechnicalQualifications",value);
							if(StringUtils.isNotBlank(zgxlValue)) {
								temp.setSubjSet(zgxlValue);
							}else{
								temp.setSubjSet(value);
							}
						}else {
							message.append("第" + num + "行专业技术资格系列不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("专业技术资格等级")) {
						if (!(value.equals(""))){
							String zgdjValue = SysDictionaryUtil.getValueByValueAndName("ProfessionalQualifications",value);
							if(StringUtils.isNotBlank(zgdjValue)) {
								temp.setSubjLevel(zgdjValue);
							}else{
								temp.setSubjLevel(value);
							}
						} else {
							message.append("第" + num + "行专业技术资格等级不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("发证单位")) {
						if (!(value.equals(""))){
							temp.setAuditOrg(value);
						} else {
							message.append("第" + num + "行发证单位为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("发证单位级别")) {
						if (!(value.equals(""))){
							String dwjbValue = SysDictionaryUtil.getValueByValueAndName("IdentificationUnitLevel",value);
							if(StringUtils.isNotBlank(dwjbValue)) {
								temp.setOrgLevel(dwjbValue);
							}else{
								temp.setOrgLevel(value);
							}
						} else {
							message.append("第" + num + "行发证单位级别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("证书编号")) {
						if (!(value.equals(""))){
							temp.setCertNo(value);
						} else {
							message.append("第" + num + "行证书编号不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_pro_tec_info);
				tProTecInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了专业技术资格信息");
			});
		}
		return messages;
	}

	/**
	 * 技能等级临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTSkillLevelInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TSkillLevelInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TSkillLevelInfoTemp temp = new TSkillLevelInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("取得时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setAcquTime(sdf2.parse(value));
								}else{
									temp.setAcquTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行取得时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行取得时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("发文时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setPostTime(sdf2.parse(value));
								}else{
									temp.setPostTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行发文时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行发文时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("技能鉴定工种")) {
						if(!(value.equals(""))){
							String jngzValue = SysDictionaryUtil.getValueByValueAndName("SkillAppraisalWork",value);
							if(StringUtils.isNotBlank(jngzValue)) {
								temp.setTechType(jngzValue);
							}else{
								temp.setTechType(value);
							}
						}else {
							message.append("第" + num + "行技能鉴定工种不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("职业资格等级")) {
						if(!(value.equals(""))){
							String zyzgValue = SysDictionaryUtil.getValueByValueAndName("QualificationLevel",value);
							if(StringUtils.isNotBlank(zyzgValue)) {
								temp.setQualifiLevel(zyzgValue);
							}else{
								temp.setQualifiLevel(value);
							}
						}else {
							message.append("第" + num + "行职业资格等级不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("发证单位")) {
						if (!(value.equals(""))){
							temp.setAuditOrg(value);
						} else {
							message.append("第" + num + "行发证单位不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("发证单位级别")) {
						if (!(value.equals(""))){
							String dwjbValue = SysDictionaryUtil.getValueByValueAndName("IdentificationUnitLevel",value);
							if(StringUtils.isNotBlank(dwjbValue)) {
								temp.setOrgLevel(dwjbValue);
							}else{
								temp.setOrgLevel(value);
							}
						} else {
							message.append("第" + num + "行发证单位级别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("证书编号")) {
						if (!(value.equals(""))){
							temp.setCertNo(value);
						} else {
							message.append("第" + num + "行证书编号不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_skill_level_info);
				tSkillLevelInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了技能等级信息");
			});
		}
		return messages;
	}

	/**
	 * 导师带徒临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTSdtTutorPrentInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TSdtTutorPrentInfoTemp> list = new ArrayList<>();
		List<TSdtPrentInfoTemp> prents = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TSdtTutorPrentInfoTemp temp = new TSdtTutorPrentInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				String prent = null;//徒弟姓名
//				String prentEncourage = null;//徒弟所获奖项
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("导师ERP")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行导师ERP不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("导师姓名")) {
						if(!(value.equals(""))){
							temp.setTutorName(value);
						}else{
							message.append("第" + num + "行导师姓名不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("师带徒开始时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setStartDate(sdf2.parse(value));
								}else{
									temp.setStartDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行师带徒开始时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行师带徒开始时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("师带徒结束时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setEndDate(sdf2.parse(value));
								}else{
									temp.setEndDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行师带徒结束时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行师带徒结束时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("徒弟姓名及所获奖项")) {
						if(!(value.equals(""))){
							value = value.replace("，",",");
							prent = value;
						}else {
							message.append("第" + num + "行徒弟姓名及所获奖项不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("师带徒内容摘要")) {
						if(!(value.equals(""))){
							temp.setTeachSummary(value);
						} else {
							message.append("第" + num + "行师带徒内容摘要不能为空").append("<br/>");
							i++;
						}
					}
				}
				if(headers.size() > i){
					//徒弟数据
					List<TSdtPrentInfoTemp> tSdtPrentInfoData = getTSdtPrentInfoData(prent,taskId);
					prents.addAll(tSdtPrentInfoData);
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_sdt_tutor_prent_info);
				tSdtTutorPrentInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了导师带徒信息");
			});
			prents.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				tSdtPrentInfoTempDao.saveInfo(p);
				//徒弟所获奖项添加
				List<TSdtAwardTemp> tSdtAwardTemps = p.gettSdtAwardList();
				if(tSdtAwardTemps != null && tSdtAwardTemps.size()>0){
					tSdtAwardTemps.forEach(t ->{
						t.setId(IdGen.uuid());
						t.setSdtTdId(p.getId());
						t.setOrgId(user.getBaseOrgId());
						t.setCreaterId(user.getFax());
						t.setCreaterName(user.getName());
						tSdtAwardTempDao.saveInfo(t);
					});
				}
			});
		}
		return messages;
	}

	/**
	 * 年度绩效临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTYearEffectInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TYearEffectInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TYearEffectInfoTemp temp = new TYearEffectInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("评级开始时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setRateYearStart(sdf2.parse(value));
								}else{
									temp.setRateYearStart(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行评级开始时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行评级开始时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("评级结束时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setRateYearEnd(sdf2.parse(value));
								}else{
									temp.setRateYearEnd(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行评级结束时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行评级结束时间不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("评级年度")) {
						if(!(value.equals(""))){
							temp.setRateYear(Integer.parseInt(value));
						}else {
							message.append("第" + num + "行评级年度不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("绩效等级")) {
						if(!(value.equals(""))){
							String jxdjValue = SysDictionaryUtil.getValueByValueAndName("PerformLevelRecentThreeYears",value);
							if(StringUtils.isNotBlank(jxdjValue)) {
								temp.setPerforGrade(jxdjValue);
							}else{
								temp.setPerforGrade(value);
							}
						}else {
							message.append("第" + num + "行绩效等级不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("剩余积分")) {
						if (!(value.equals(""))){
							double resiInte = Double.valueOf(value);
							temp.setResiInte(resiInte);
						} else {
							message.append("第" + num + "行剩余积分不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("本年度已获取积分")) {
						if (!(value.equals(""))){
							double curInte = Double.valueOf(value);
							temp.setCurInte(curInte);
						} else {
							message.append("第" + num + "行本年度已获取积分不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_year_effect_info);
				tYearEffectInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了年度绩效信息");
			});
		}
		return messages;
	}

	/**
	 *  学术成果临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTAcadeAchiveInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TAcadeAchiveInfoTemp> list = new ArrayList<>();
		List<TPartRankTemp> rankList = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TAcadeAchiveInfoTemp temp = new TAcadeAchiveInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				String erpNo = null;
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("编号")) {
						if(!(value.equals(""))){
						}else{
							i++;
						}
					}else if (headers.get(s).equals("作者")) {
						if(!(value.equals(""))){
							value = value.replace("，",",").replace("、",",");
							erpNo = value;
						}else{
							message.append("第" + num + "行作者不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("发表时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setPubTime(sdf2.parse(value));
								}else{
									temp.setPubTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行发表时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行发表时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("类别（专著、论文）")) {
						if(!(value.equals(""))){
							String lbValue = SysDictionaryUtil.getValueByValueAndName("XueshuchengguoType",value);
							if(StringUtils.isNotBlank(lbValue)) {
								temp.setAcadType(lbValue);
							}else{
								temp.setAcadType(value);
							}
						}else {
							message.append("第" + num + "行类别（专著、论文）不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("论文（专著）名称")) {
						if(!(value.equals(""))){
							temp.setAcadName(value);
						}else {
							message.append("第" + num + "行论文（专著）名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("内容摘要")) {
						if (!(value.equals(""))){
							temp.setSummary(value);
						} else {
							i++;
						}
					}else if (headers.get(s).equals("刊物名称")) {
						if (!(value.equals(""))){
							temp.setPubName(value);
						} else {
							message.append("第" + num + "行刊物名称不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("卷/期数")) {
						if (!(value.equals(""))){
							temp.setPeriodicNo(value);
						} else {
							message.append("第" + num + "行卷/期数不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("页码")) {
						if (!(value.equals(""))){
							temp.setPage(Integer.parseInt(value));
						} else {
							message.append("第" + num + "行页码不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("期刊号")) {
						if (!(value.equals(""))){
							temp.setIssn(value);
						} else {
							message.append("第" + num + "行期刊号不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("出版社名称")) {
						if (!(value.equals(""))){
							temp.setPublisher(value);
						} else {
							message.append("第" + num + "行出版社名称不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("级别")) {
						if (!(value.equals(""))){
							String jbValue = SysDictionaryUtil.getValueByValueAndName("XueshuchengguoJb",value);
							if(StringUtils.isNotBlank(jbValue)) {
								temp.setLevel(jbValue);
							}else{
								temp.setLevel(value);
							}
						} else {
							message.append("第" + num + "行级别不能为空").append("<br/>");
							i++;
						}
					}
				}
				if(headers.size() > i){
					//参与者数据
					Map<String,Object> map = getTPartRankData(erpNo,taskId,"12",erpNos,num);
					List<TPartRankTemp> ranks = (List<TPartRankTemp>) map.get("ranks");
					if(ranks == null || ranks.size() == 0){
						String userMessage = (String)map.get("message");
						messages.append(userMessage);
					}else{
						rankList.addAll(ranks);
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_acade_achive_info);
				tAcadeAchiveInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了学术成果信息");
			});
			rankList.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				tPartRankTempDao.saveInfo(p);
			});
		}
		return messages;
	}

	/**
	 *  标准制定临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTStandInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TStandInfoTemp> list = new ArrayList<>();
		List<TPartRankTemp> rankList = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TStandInfoTemp temp = new TStandInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				String erpNo = null;
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("编号")) {
						if(!(value.equals(""))){
						}else{
							i++;
						}
					}else if (headers.get(s).equals("作者")) {
						if(!(value.equals(""))){
							value = value.replace("，",",").replace("、",",");
							erpNo = value;
						}else{
							message.append("第" + num + "行作者不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("颁布时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setIssueTime(sdf2.parse(value));
								}else{
									temp.setIssueTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行颁布时间格式错误").append("<br/>");
							}

						}else {
							message.append("第" + num + "行颁布时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("名称")) {
						if(!(value.equals(""))){
							temp.setName(value);
						}else {
							message.append("第" + num + "行名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("类别")) {
						if(!(value.equals(""))){
							String lbValue = SysDictionaryUtil.getValueByValueAndName("ZdbzType",value);
							if(StringUtils.isNotBlank(lbValue)) {
								temp.setType(lbValue);
							}else{
								temp.setType(value);
							}
						}else {
							message.append("第" + num + "行类别不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("级别")) {
						if (!(value.equals(""))){
							value = value.replace("（","(").replace("）",")");
							String jbValue = SysDictionaryUtil.getValueByValueAndName("JygexinQcJb",value);
							if(StringUtils.isNotBlank(jbValue)) {
								temp.setLevel(jbValue);
							}else{
								temp.setLevel(value);
							}
						} else {
							message.append("第" + num + "行级别不能为空").append("<br/>");
							i++;
						}
					}
				}
				if(headers.size() > i){
					//参与者数据
					Map<String,Object> map = getTPartRankData(erpNo,taskId,"13",erpNos,num);
					List<TPartRankTemp> ranks = (List<TPartRankTemp>) map.get("ranks");
					if(ranks == null || ranks.size() == 0){
						String userMessage = (String)map.get("message");
						messages.append(userMessage);
					}else{
						rankList.addAll(ranks);
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_stand_info);
				tStandInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了标准制定信息");
			});
			rankList.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				tPartRankTempDao.saveInfo(p);
			});
		}
		return messages;
	}

	/**
	 *  专利临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTPatentInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TPatentInfoTemp> list = new ArrayList<>();
		List<TPartRankTemp> rankList = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TPatentInfoTemp temp = new TPatentInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				String erpNo = null;
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("编号")) {
						if(!(value.equals(""))){
						}else{
							i++;
						}
					}else if (headers.get(s).equals("发明人（专利权人）")) {
						if(!(value.equals(""))){
							value = value.replace("，",",").replace("、",",");
							erpNo = value;
						}else{
							message.append("第" + num + "行发明人（专利权人）不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("名称")){
						if(!(value.equals(""))){
							temp.setPatentName(value);
						}else {
							message.append("第" + num + "行名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("专利号")) {
						if(!(value.equals(""))){
							temp.setPatentNo(value);
						}else {
							message.append("第" + num + "行专利号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("类型")) {
						if(!(value.equals(""))){
							String lxValue = SysDictionaryUtil.getValueByValueAndName("PatentType",value);
							if(StringUtils.isNotBlank(lxValue)) {
								temp.setPatentType(lxValue);
							}else{
								temp.setPatentType(value);
							}
						}else {
							message.append("第" + num + "行类型不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("专利申请日")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setApplyDate(sdf2.parse(value));
								}else{
									temp.setApplyDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行专利申请日格式错误").append("<br/>");
							}
						} else {
							message.append("第" + num + "行专利申请日不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("授权公告日")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setDeclDate(sdf2.parse(value));
								}else{
									temp.setDeclDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行授权公告日格式错误").append("<br/>");
							}
						} else {
							message.append("第" + num + "行授权公告日不能为空").append("<br/>");
							i++;
						}
					}
				}
				if(headers.size() > i){
					//参与者数据
					Map<String,Object> map = getTPartRankData(erpNo,taskId,"14",erpNos,num);
					List<TPartRankTemp> ranks = (List<TPartRankTemp>) map.get("ranks");
					if(ranks == null || ranks.size() == 0){
						String userMessage = (String)map.get("message");
						messages.append(userMessage);
					}else{
						rankList.addAll(ranks);
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_patent_info);
				tPatentInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了专利信息");
			});
			rankList.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				tPartRankTempDao.saveInfo(p);
			});
		}
		return messages;
	}

	/**
	 *  技艺革新临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTTecInnovInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TTecInnovInfoTemp> list = new ArrayList<>();
		List<TPartRankTemp> rankList = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TTecInnovInfoTemp temp = new TTecInnovInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				String erpNo = null;
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("编号")) {
						if(!(value.equals(""))){
						}else{
							i++;
						}
					}else if (headers.get(s).equals("QC小组成员姓名")) {
						if(!(value.equals(""))){
							value = value.replace("，",",").replace(".",",").replace("、",",");
							erpNo = value;
						}else{
							message.append("第" + num + "行QC小组成员姓名不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("QC成果名称")){
						if(!(value.equals(""))){
							temp.setAchiName(value);
						}else {
							message.append("第" + num + "行QC成果名称不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("QC获奖名称")){
						if(!(value.equals(""))){
							temp.setAwardName(value);
						}else {
							message.append("第" + num + "行QC获奖名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("内容摘要")) {
						if(!(value.equals(""))){
							temp.setSumary(value);
						}else {
							message.append("第" + num + "行内容摘要不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("QC获奖时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setAwardDate(sdf2.parse(value));
								}else{
									temp.setAwardDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行QC获奖时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行QC获奖时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("QC奖项授予单位")) {
						if (!(value.equals(""))){
							temp.setAwardOrg(value);
						} else {
							message.append("第" + num + "行QC奖项授予单位不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("QC获奖级别")) {
						if (!(value.equals(""))){
							value = value.replace("（","(").replace("）",")");
							String hjjbValue = SysDictionaryUtil.getValueByValueAndName("JygexinQcJb",value);
							if(StringUtils.isNotBlank(hjjbValue)) {
								temp.setAwardLevel(hjjbValue);
							}else{
								temp.setAwardLevel(value);
							}
						} else {
							message.append("第" + num + "行QC获奖级别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("奖项等级")) {
						if (!(value.equals(""))){
							String hjdjValue = SysDictionaryUtil.getValueByValueAndName("JygexinQcDj",value);
							if(StringUtils.isNotBlank(hjdjValue)) {
								temp.setAwardGrade(hjdjValue);
							}else{
								temp.setAwardGrade(value);
							}
						} else {
							message.append("第" + num + "行奖项等级不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("QC小组名称")) {
						if (!(value.equals(""))){
							temp.setGroupName(value);
						} else {
							message.append("第" + num + "行QC小组名称不能为空").append("<br/>");
							i++;
						}
					}
				}
				if(headers.size() > i){
					//参与者数据
					Map<String,Object> map = getTPartRankData(erpNo,taskId,"15",erpNos,num);
					List<TPartRankTemp> ranks = (List<TPartRankTemp>) map.get("ranks");
					if(ranks == null || ranks.size() == 0){
						String userMessage = (String)map.get("message");
						messages.append(userMessage);
					}else{
						rankList.addAll(ranks);
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_tec_innov_info);
				tTecInnovInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了技艺革新信息");
			});
			rankList.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				tPartRankTempDao.saveInfo(p);
			});
		}
		return messages;
	}

	/**
	 *  科技创新临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTTecManInnovTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TTecManInnovTemp> list = new ArrayList<>();
		List<TPartRankTemp> rankList = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TTecManInnovTemp temp = new TTecManInnovTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				String erpNo = null;
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("编号")) {
						if(!(value.equals(""))){
						}else{
							i++;
						}
					} else if (headers.get(s).equals("获奖成员姓名")) {
						if(!(value.equals(""))){
							value = value.replace("，",",").replace(".",",").replace("、",",");
							erpNo = value;
						}else{
							message.append("第" + num + "行获奖成员姓名不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("成果名称")){
						if(!(value.equals(""))){
							temp.setAchiName(value);
						}else {
							message.append("第" + num + "行成果名称不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("成果类别")){
						if(!(value.equals(""))){
							String cglbValue = SysDictionaryUtil.getValueByValueAndName("KjglAchiveType",value);
							if(StringUtils.isNotBlank(cglbValue)){
								temp.setAchiType(cglbValue);
							}else{
								temp.setAchiType(value);
							}
						}else {
							message.append("第" + num + "行成果类别不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("内容摘要")) {
						if(!(value.equals(""))){
							temp.setSummary(value);
						}else {
							i++;
						}
					}else if (headers.get(s).equals("获奖名称")) {
						if(!(value.equals(""))){
							temp.setAwardName(value);
						}else {
							message.append("第" + num + "行获奖名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("获奖时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setAwardDate(sdf2.parse(value));
								}else{
									temp.setAwardDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行获奖时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行获奖时间不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("奖项授予单位")) {
						if (!(value.equals(""))){
							temp.setAwardOrg(value);
						} else {
							message.append("第" + num + "行奖项授予单位不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("获奖级别")) {
						if (!(value.equals(""))){
							value = value.replace("（","(").replace("）",")");
							String hjjbValue = SysDictionaryUtil.getValueByValueAndName("JygexinQcJb",value);
							if(StringUtils.isNotBlank(hjjbValue)) {
								temp.setAwardLevel(hjjbValue);
							}else{
								temp.setAwardLevel(value);
							}
						} else {
							message.append("第" + num + "行获奖级别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("奖项等级")) {
						if (!(value.equals(""))){
							String jxdjValue = SysDictionaryUtil.getValueByValueAndName("JygexinQcDj",value);
							if(StringUtils.isNotBlank(jxdjValue)) {
								temp.setAwardGrade(jxdjValue);
							}else{
								temp.setAwardGrade(value);
							}
						} else {
							message.append("第" + num + "行奖项等级不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("小组名称")) {
						if (!(value.equals(""))){
							temp.setGroupName(value);
						} else {
							message.append("第" + num + "行小组名称不能为空").append("<br/>");
							i++;
						}
					}
				}
				if(headers.size() > i){
					//参与者数据
					Map<String,Object> map = getTPartRankData(erpNo,taskId,"16",erpNos,num);
					List<TPartRankTemp> ranks = (List<TPartRankTemp>) map.get("ranks");
					if(ranks == null || ranks.size() == 0){
						String userMessage = (String)map.get("message");
						messages.append(userMessage);
					}else{
						rankList.addAll(ranks);
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_tec_man_innov);
				tTecManInnovTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了科技创新管理信息");
			});
			rankList.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				tPartRankTempDao.saveInfo(p);
			});
		}
		return messages;
	}

	/**
	 *  课题成果临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTProjAchieveInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TProjAchieveInfoTemp> list = new ArrayList<>();
		List<TPartRankTemp> rankList = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TProjAchieveInfoTemp temp = new TProjAchieveInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				String erpNo = null;
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("编号")) {
						if(!(value.equals(""))){
						}else{
							i++;
						}
					}else if (headers.get(s).equals("小组成员")) {
						if(!(value.equals(""))){
							value = value.replace("，",",").replace(".",",").replace("、",",");
							erpNo = value;
						}else{
							message.append("第" + num + "行小组成员不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("开始时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setStartDate(sdf2.parse(value));
								}else{
									temp.setStartDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行开始时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行开始时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("结束时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setEndDate(sdf2.parse(value));
								}else{
									temp.setEndDate(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行结束时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行结束时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("课题名称")) {
						if(!(value.equals(""))){
							temp.setProjName(value);
						}else {
							message.append("第" + num + "行课题名称不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("内容摘要")) {
						if (!(value.equals(""))){
							temp.setSummary(value);
						} else {
							i++;
						}
					}else if (headers.get(s).equals("项目或课题级别")) {
						if (!(value.equals(""))){
							value = value.replace("（","(").replace("）",")");
							String ktjbValue = SysDictionaryUtil.getValueByValueAndName("StandardLevel",value);
							if(StringUtils.isNotBlank(ktjbValue)) {
								temp.setProjLevel(ktjbValue);
							}else{
								temp.setProjLevel(value);
							}
						} else {
							message.append("第" + num + "行项目或课题级别不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("获得奖励及社会经济效益")) {
						if (!(value.equals(""))){
							temp.setEncourage(value);
						} else {
							i++;
						}
					}
				}
				if(headers.size() > i){
					//参与者数据
					Map<String,Object> map = getTPartRankData(erpNo,taskId,"17",erpNos,num);
					List<TPartRankTemp> ranks = (List<TPartRankTemp>) map.get("ranks");
					if(ranks == null || ranks.size() == 0){
						String userMessage = (String)map.get("message");
						messages.append(userMessage);
					}else{
						rankList.addAll(ranks);
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_proj_achieve_info);
				tProjAchieveInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了项目课题成果信息");
			});
			rankList.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				tPartRankTempDao.saveInfo(p);
			});
		}
		return messages;
	}

	/**
	 *  员工流动临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTEmployeeMobilityTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TEmployeeMobilityTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TEmployeeMobilityTemp temp = new TEmployeeMobilityTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("流动类型")){
						if(!(value.equals(""))){
							String flowType = SysDictionaryUtil.getValueByValueAndName("FlowType",value);
							try {
								if(StringUtils.isNotBlank(flowType)){
									temp.setFlowType(flowType);
								}else{
									temp.setFlowType(value);
								}
							}catch (Exception e){
								message.append("第" + num + "行流动类型格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行流动类型不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("流动区域")) {
						if(!(value.equals(""))){
							String flowArea = SysDictionaryUtil.getValueByValueAndName("FlowArea",value);
							try {
								if(StringUtils.isNotBlank(flowArea)){
									temp.setFlowArea(flowArea);
								}else{
									temp.setFlowArea(value);
								}
							}catch (Exception e){
								message.append("第" + num + "行流动区域格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行流动区域不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("流动方式")) {
						if(!(value.equals(""))){
							String flowMode = SysDictionaryUtil.getValueByValueAndName("FlowMode",value);
							try {
								if(StringUtils.isNotBlank(flowMode)) {
									temp.setFlowMode(flowMode);
								}else{
									temp.setFlowMode(value);
								}
							}catch (Exception e){
								message.append("第" + num + "行流动方式格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行流动方式不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("开始时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setBeginTime(sdf2.parse(value));
								}else{
									temp.setBeginTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行开始时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行开始时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("结束时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setEndTime(sdf2.parse(value));
								}else{
									temp.setEndTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行结束时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行结束时间不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_employee_mobility);
				tEmployeeMobilityTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了员工流动信息");
			});
		}
		return messages;
	}

	/**
	 *  挂职轮岗临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTRotationInfoTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TRotationInfoTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 3; rowNum <= lastRowNum; rowNum++) {//列
			TRotationInfoTemp temp = new TRotationInfoTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							message.append("第" + num + "行姓名不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("挂职单位")){
						if(!(value.equals(""))){
							temp.setRotationDept(value);
						}else {
							message.append("第" + num + "行挂职单位不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("挂职部门")) {
						if(!(value.equals(""))){
							temp.setRotationOrg(value);
						}else {
							message.append("第" + num + "行挂职部门不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("挂职岗位")) {
						if(!(value.equals(""))){
							temp.setRotationPost(value);
						}else {
							message.append("第" + num + "行挂职岗位不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("开始时间")){
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setStartTime(sdf2.parse(value));
								}else{
									temp.setStartTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行开始时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行开始时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("结束时间")) {
						if(!(value.equals(""))){
							value = value.replace("/","-").replace(".","-").replace("年","-").replace("月","-").replace("日","");
							try {
								if(value.length()>7){
									temp.setEndTime(sdf2.parse(value));
								}else{
									temp.setEndTime(sdf1.parse(value));
								}
							}catch (Exception e){
								message.append("第" + num + "行结束时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行结束时间不能为空").append("<br/>");
							i++;
						}
					}
				}
				temp.setId(taskId);
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setOrgId(user.getBaseOrgId());
				p.setOrignalId(p.getId());
				p.setPrimitiveId(p.getId());
				p.setIsValid(0);
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				p.setBusinessTypeId(t_employee_mobility);
				tRotationInfoTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了挂职轮岗信息");
			});
		}
		return messages;
	}

	/**
	 * 绩效积分信息入临时库
	 * @param sheet
	 * @return
	 */
	public StringBuffer importTPerformanceScoreTempList(Sheet sheet,int firstRowNum,int lastRowNum,List<String> headers,User user,List<String> erpNos) throws Exception{
		StringBuffer messages = new StringBuffer();
		List<TPerformanceScoreTemp> list = new ArrayList<>();
		for (int rowNum = firstRowNum + 2; rowNum <= lastRowNum; rowNum++) {//列
			TPerformanceScoreTemp temp = new TPerformanceScoreTemp();
			StringBuffer message = new StringBuffer();
			//获得当前行
			Row row = sheet.getRow(rowNum);
			int i = 0;
			if (row != null) {
				int num = rowNum+1;
				//id
//				String taskId = IdGen.uuid();
				for(int s=0;s<headers.size();s++) {
					Cell cell = row.getCell(s);
					if(cell == null){
						cell = row.createCell(s);
						cell.setCellValue("");
					}
					String value = getValueByCell(cell);
					if (headers.get(s).equals("ERP编号")) {
						if(!(value.equals(""))){
							if(erpNos.contains(value)){
								temp.setErpNo(value);
							}else{
								message.append("第" + num + "行erp编号错误，请核对后再导入").append("<br/>");
							}
						}else{
							message.append("第" + num + "行erp编号不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("姓名")){
						if(!(value.equals(""))){
							temp.setUserName(value);
						}else {
							i++;
							message.append("第" + num + "行姓名不能为空").append("<br/>");
						}
					}else if (headers.get(s).equals("时间")){
						if(!(value.equals(""))){
							try{
								temp.setYear(Integer.parseInt(value));
							}catch (Exception e){
								message.append("第" + num + "行时间格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行时间不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("现薪档")) {
						if(!(value.equals(""))){
							temp.setSalaryGrade(value);
						}else {
							message.append("第" + num + "行现薪档不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("现薪级")) {
						if(!(value.equals(""))){
							try{
								temp.setSalaryLevel(Integer.parseInt(value));
							}catch (Exception e){
								message.append("第" + num + "行现薪级格式错误").append("<br/>");
							}
						}else {
							message.append("第" + num + "行现薪级不能为空").append("<br/>");
							i++;
						}
					} else if (headers.get(s).equals("年度绩效")) {
						if (!(value.equals(""))){
							String jxdjValue = SysDictionaryUtil.getValueByValueAndName("PerformLevelRecentThreeYears",value);
							if(StringUtils.isNotBlank(jxdjValue)) {
								temp.setPerforGrade(jxdjValue);
							}else{
								temp.setPerforGrade(value);
							}
						} else {
							message.append("第" + num + "行年度绩效不能为空").append("<br/>");
							i++;
						}
					}else if (headers.get(s).equals("上年度剩余积分")) {
						if (!(value.equals(""))){
							try{
								double resiInte = Double.valueOf(value);
								temp.setRemainPoint(resiInte);
							}catch (Exception e){
								message.append("第" + num + "行上年度剩余积分格式错误").append("<br/>");
							}
						} else {
							message.append("第" + num + "行上年度剩余积分不能为空").append("<br/>");
							i++;
						}
					}
				}
			}
			if(i == headers.size()){
				break;
			}else{
				messages.append(message);
				list.add(temp);
			}
		}
		if(messages.length()==0){
			//入临时库
			list.forEach(p ->{
				p.setId(IdGen.uuid());
				p.setCreaterId(user.getFax());
				p.setCreaterName(user.getName());
				p.setUpdaterId(user.getFax());
				p.setUpdaterName(user.getName());
				tPerformanceScoreTempDao.saveInfo(p);
				addRecordLogData(user,p.getId(),user.getName()+"新增导入了绩效积分信息");
			});
		}
		return messages;
	}

	/**
	 * 参与人排名表数据获取
	 */
	public Map<String,Object> getTPartRankData(String user,String taskId,String type,List<String> erpNos,int num){
		Map<String,Object> map = new HashMap<>();
		List<TPartRankTemp> ranks = new ArrayList<>();
		List<TPartRankTemp> rankList = new ArrayList<>();
		StringBuffer message = new StringBuffer();
		if(!StringUtil.isNullOrEmpty(user)){
			String [] users = user.split(",");
			for(int i=0;i<users.length;i++){
				TPartRankTemp rank = new TPartRankTemp();
				rank.setId(IdGen.uuid());
				rank.setItemId(taskId);//数据项id
				rank.setItemType(type);//数据项类型
				String singleUser = users[i];
				String [] userEntity = singleUser.split("[|]");
				int n = i+1;
				if(type.equals("17")){//项目课题成果角色是一个标准
					if(userEntity.length > 0){
						if(userEntity.length == 4){
							String jsValue = SysDictionaryUtil.getValueByValueAndName("XiangMuKeTiJS",userEntity[0]);
							if(StringUtils.isNotBlank(jsValue)){
								rank.setRole(jsValue);//角色
							}else{
								rank.setRole(userEntity[0]);//角色
							}
							rank.setUserName(userEntity[1]);//姓名
							if(erpNos.contains(userEntity[2])){
								rank.setErpNo(userEntity[2]);//人员erp编号
							}else{
								message.append("第" + num + "行第" + n + "位人资编号错误，请核对后再导入").append("<br/>");
							}
							rank.setRank(Integer.parseInt(userEntity[3]));//排名
							ranks.add(rank);
						}else{
							message.append("第" + num + "行人员格式不正确，请核对后再导入").append("<br/>");
						}
					}
				}else if(type.equals("12") || type.equals("13")){//学术成果和制度标准角色是一个标准
					if(userEntity.length > 0){
						if(userEntity.length == 4){
							String jsValue = SysDictionaryUtil.getValueByValueAndName("XueshuchengguoJs",userEntity[0]);
							if(StringUtils.isNotBlank(jsValue)){
								rank.setRole(jsValue);//角色
							}else{
								rank.setRole(userEntity[0]);//角色
							}
							rank.setUserName(userEntity[1]);//姓名
							if(erpNos.contains(userEntity[2])){
								rank.setErpNo(userEntity[2]);//人员erp编号
							}else{
								message.append("第" + num + "行第" + n + "位人资编号错误，请核对后再导入").append("<br/>");
							}
							rank.setRank(Integer.parseInt(userEntity[3]));//排名
							ranks.add(rank);
						}else{
							message.append("第" + num + "行人员格式不正确，请核对后再导入").append("<br/>");
						}
					}
				}else {//专利、技艺革新和科技创新管理都没有角色
					if(userEntity.length > 0){
						if(userEntity.length == 3){
							rank.setUserName(userEntity[0]);//姓名
							if(erpNos.contains(userEntity[1])){
								rank.setErpNo(userEntity[1]);//人员erp编号
							}else{
								message.append("第" + num + "行第" + n + "位人资编号错误，请核对后再导入").append("<br/>");
							}
							rank.setRank(Integer.parseInt(userEntity[2]));//排名
							ranks.add(rank);
						}else{
							message.append("第" + num + "行人员格式不正确，请核对后再导入").append("<br/>");
						}
					}
				}
			}
		}else{
			message.append("人员不能为空且格式要严格按照模板样式");
		}
		if(ranks != null && ranks.size() > 0){
			rankList = ranks.stream() .collect(Collectors.collectingAndThen(Collectors.toCollection(()-> new TreeSet<>(Comparator.comparing(TPartRankTemp::getErpNo))), ArrayList::new));
		}
		if(message.length() == 0){
			map.put("ranks",rankList);
			map.put("message",null);
		}else{
			map.put("message",message.toString());
			map.put("ranks",null);
		}
		return map;
	}

	/**
	 * 徒弟数据获取
	 */
	public List<TSdtPrentInfoTemp> getTSdtPrentInfoData(String prent,String taskId){
		List<TSdtPrentInfoTemp> temps = new ArrayList<>();
		if(StringUtils.isNotBlank(prent)){
			String [] users = prent.split(",");
			for(int i=0;i<users.length;i++){
				TSdtPrentInfoTemp entity = new TSdtPrentInfoTemp();
				entity.setId(IdGen.uuid());
				String singleUser = users[i];
				String [] userEntity = singleUser.split("[|]");
				if(userEntity != null && userEntity.length > 1){
					entity.setUserName(userEntity[0]);//徒弟姓名
					entity.setErpNo(userEntity[1]);//徒弟erp编号
					if(userEntity.length > 2){
						String awardStr = userEntity[2];//所获奖项
						if(awardStr != null && !(awardStr.equals("无"))){
							if(!StringUtil.isNullOrEmpty(awardStr)){
								List<TSdtAwardTemp> tSdtAwardTemps = new ArrayList<>();
								String [] awards = awardStr.split("、");
								if(awards.length > 0){
									for(String award:awards){
										TSdtAwardTemp temp = new TSdtAwardTemp();
										temp.setAward(award);
										temp.setItemId(award);
										temp.setSdtTdId(entity.getId());
										tSdtAwardTemps.add(temp);
									}
								}
								entity.settSdtAwardList(tSdtAwardTemps);
							}
						}
					}
				}
				entity.setSdtId(taskId);//数据项id
				temps.add(entity);
			}
		}
		return temps;
	}

	public String getValueByCell(Cell cell){
		CellType cellType = cell.getCellTypeEnum();
		String value;
		if(cellType.equals(CellType.NUMERIC)){
			//日期格式处理
			if(DateUtilCheck.isCellDateFormatted(cell)){
				cell.setCellType(CellType.STRING);
				value = cell.getStringCellValue().trim();
				Date date = HSSFDateUtil.getJavaDate(Double.parseDouble(value));
				value = sdf2.format(date);
			}else{//数值格式
				cell.setCellType(CellType.STRING);
				value = cell.getStringCellValue().trim();
			}
		}else{
			value = cell.getStringCellValue().trim();
		}
		return value;
	}

	/**
	 * 公共方法--插入操作记录
	 */
	public void addRecordLogData(User user,String recordId,String content){
		//插入操作记录
		TRecordOptLog log = new TRecordOptLog();
		log.setRecordId(recordId);
		log.setOptContent(content);
		log.setOptType("0");
		recordLogService.save(user,log);
	}

}
